﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ToolStripDropDownButtonAdapter.cs" company="">
//   
// </copyright>
// <summary>
//   The tool strip drop down button adapter.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace Libium.Adapters
{
    using System.Windows.Forms;

    using Libium.Views;

    /// <summary>
    /// The tool strip drop down button adapter.
    /// </summary>
    public class ToolStripDropDownButtonAdapter : ToolStripItemAdapter<ToolStripDropDownButton>, ICommandMenuView
    {
        #region Constructors and Destructors

        /// <summary>
        /// Initializes a new instance of the <see cref="ToolStripDropDownButtonAdapter"/> class.
        /// </summary>
        /// <param name="button">
        /// The button.
        /// </param>
        public ToolStripDropDownButtonAdapter(ToolStripDropDownButton button)
            : base(button)
        {
        }

        #endregion

        #region Public Properties

        /// <summary>
        /// Gets or sets the name.
        /// </summary>
        public string Name
        {
            get
            {
                return string.Empty;
            }

            set
            {
            }
        }

        /// <summary>
        /// Gets or sets the text.
        /// </summary>
        public string Text
        {
            get
            {
                return Control.Text;
            }

            set
            {
                Control.Text = value;
            }
        }

        /// <summary>
        /// Gets or sets the tooltip.
        /// </summary>
        public string Tooltip
        {
            get
            {
                return Control.ToolTipText;
            }

            set
            {
                Control.ToolTipText = value;
            }
        }

        #endregion

        #region Public Methods and Operators

        /// <summary>
        /// The add command view.
        /// </summary>
        /// <returns>
        /// The <see cref="object"/>.
        /// </returns>
        public object AddCommandView()
        {
            var button = new ToolStripButton();
            Control.DropDownItems.Add(button);
            return button;
        }

        #endregion
    }
}